<template>
  <el-container class="container">
    <el-header>
      <!--头部-->
      <header-component></header-component>
    </el-header>
    <el-container class="section-content">
      <el-aside width="200px" height="700px">
        <!--菜单-->
        <menu-component></menu-component>
      </el-aside>
      <el-main>
        <!--面包屑-->
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/personal/center' }">个人中心</el-breadcrumb-item>
          <el-breadcrumb-item>我的资料</el-breadcrumb-item>
          <el-breadcrumb-item>个人详情</el-breadcrumb-item>
        </el-breadcrumb>
        <!--嵌套的子页面-->
        <router-view></router-view>
      </el-main>
    </el-container>
    <el-footer>
      <!--底部-->
      <footer-component></footer-component>
    </el-footer>
  </el-container>
</template>

<script>
import MenuComponent from './menu/MenuComponent'
import HeaderComponent from '@/components/header/HeaderComponent'
import FooterComponent from '@/components/footer/FooterComponent'
export default {
  name: 'PersonalCenter',
  components: {FooterComponent, HeaderComponent, MenuComponent},
  data () {
    return {
      levelList: null
    }
  },
  watch: {
    $route () {
      this.getBreadCrumb()
    }
  },
  methods: {
    getBreadCrumb: function () {
      // $route.matched一个数组 包含当前路由的所有嵌套路径片段的路由记录
      console.log(this.$route.matched)
      this.levelList = this.$route.matched.filter(item => item.url)
    }
  }
}
</script>

<style scoped>
  .container{
  }
>>>
.el-main{
  min-width: 800px;
  height: 100%;
  background-color: #F6F6F6;
  padding: 0px;
  border-right: 1px solid #F6F6F6;
}
.el-breadcrumb{
  margin-left:0px;
  padding-left: 15px;
}
.el-footer{
  padding: 0;
}
</style>
